//
//  PlatformWalletBillCell.m
//  reSearchDemo
//
//  Created by 科技 on 15/8/21.
//  Copyright (c) 2015年 Kiwaro. All rights reserved.
//

#import "PlatformWalletBillCell.h"
#import "WalletBillModel.h"
@interface PlatformWalletBillCell() {
    UILabel *nameText;
    UILabel *timeText;
    UILabel *moneyText;
    UILabel *name;
    UILabel *time;
    UILabel *money;
}
@end
@implementation PlatformWalletBillCell

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        nameText = [[UILabel alloc] init];
        timeText = [[UILabel alloc] init];
        timeText.textAlignment = NSTextAlignmentCenter;
        moneyText = [[UILabel alloc] init];
        moneyText.textAlignment = NSTextAlignmentRight;
        name = [[UILabel alloc] init];
        time = [[UILabel alloc] init];
        time.textAlignment = NSTextAlignmentCenter;
        money = [[UILabel alloc] init];
        money.textAlignment = NSTextAlignmentRight;
        
        [self.contentView addSubview:nameText];
        [self.contentView addSubview:timeText];
        [self.contentView addSubview:moneyText];
        [self.contentView addSubview:name];
        [self.contentView addSubview:time];
        [self.contentView addSubview:money];
    }
    return self;
}

-(void)setModel:(WalletBillModel *)model {
    nameText.frame = CGRectMake(10, 5, (CGRectGetWidth(self.contentView.frame)-20)/3, 20);
    nameText.text = @"名称";
    timeText.frame = CGRectMake((CGRectGetWidth(self.contentView.frame)-20)/3 + 10, CGRectGetMinY(nameText.frame), (CGRectGetWidth(self.contentView.frame)-20)/3, CGRectGetHeight(nameText.frame));
    timeText.text = @"时间";
    moneyText.frame = CGRectMake((CGRectGetWidth(self.contentView.frame)-20)/3*2 + 10, CGRectGetMinY(nameText.frame), (CGRectGetWidth(self.contentView.frame)-20)/3, CGRectGetHeight(nameText.frame));
    moneyText.text = @"金额";
    name.frame = CGRectMake(CGRectGetMinX(nameText.frame), CGRectGetMaxY(nameText.frame), (CGRectGetWidth(self.contentView.frame)-20)/3, CGRectGetHeight(nameText.frame));
    name.text = model.name;
    time.frame = CGRectMake(CGRectGetMinX(timeText.frame), CGRectGetMaxY(timeText.frame), (CGRectGetWidth(self.contentView.frame)-20)/3, CGRectGetHeight(timeText.frame));
    time.text = model.time;
    money.frame = CGRectMake(CGRectGetMinX(moneyText.frame), CGRectGetMaxY(moneyText.frame), (CGRectGetWidth(self.contentView.frame)-20)/3, CGRectGetHeight(moneyText.frame));
    money.text = model.money;
    
    _height = CGRectGetMaxY(money.frame) + 5;
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
